<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>物业管理软件</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
	<meta name="author" content="Muhammad Usman">

	<#include "*/pubcss.ftl">
		
</head>

<body>
	<#include "*/top.ftl">
	<!-- topbar ends -->
	<div class="container-fluid">
		<div class="row-fluid">
			<#include "*/left.ftl">
			<div id="content" class="span10">
			<!-- content starts -->
			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">仪表管理</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">电表管理</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">电表维护</a>
					</li>
				</ul>
			</div>
		    <form class="form-horizontal"  action="javascript:saveAnmeter()">
		    <div class="row-fluid sortable">
			    <button type="submit" class="btn btn-primary">保存</button>
				<button type="button" class="btn btn-primary" onclick="javascript:window.history.back();">返回</button>
		    </div>
			<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-user"></i>电表信息</h2>
					</div>
					<div class="box-content">
						<div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">表号</label>
									<div class="controls">
									    <input class="input-xlarge focused" id="acode" name="acode" type="hidden" value="${(anmeter.acode)?if_exists}">
										<input class="input-xlarge focused" id="snum" name="snum" type="text" value="${(anmeter.snum)?if_exists}">
									</div>
								</div>
								</fieldset> 
							</div>
							<div class="span6">
							   <div class="control-group form-horizontal">
								<label class="control-label">厂家</label>
								<div class="controls form-horizontal">
								  <input class="input-xlarge focused" id="company" name="company" type="text" value="${(anmeter.company)?if_exists}">
								</div>
							  </div>
							</div>
                        </div>
						<div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">电表型号</label>
									<div class="controls">
										<input class="input-xlarge focused" id="type" name="type" type="text" value="${(anmeter.type)?if_exists}">
									</div>
								</div>
								</fieldset> 
							</div>
							<div class="span6">
							   <div class="control-group form-horizontal">
								<label class="control-label">更换周期</label>
								<div class="controls form-horizontal">
								  <input class="input-xlarge focused" id="cycle" name="cycle" type="text" value="${(anmeter.cycle)?if_exists}">
								</div>
							  </div>
							</div>
                        </div>
						<div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">分摊规则</label>
									<div class="controls">
										<select id="sid" name="sid" onchange="share()">
										   <#list spreads as spread>
										   <option value="${(spread.sid)?if_exists}" <#if spread.sid==(anmeter.spread.sid)?if_exists>selected</#if>>${(spread.sname)?if_exists}</option>
										   </#list>
										</select>
									</div>
								</div>
								</fieldset> 
							</div>
							<div class="span6">
							   <div class="control-group form-horizontal">
								<label class="control-label">抄表人员</label>
								<div class="controls">
								        <select id="pid" name="pid">
								           <#list readPersons as person>
										   <option value="${(person.pid)?if_exists}" <#if person.pid==(anmeter.readPerson.pid)?if_exists>selected</#if>>${(person.pname)?if_exists}</option>
										   </#list>
										</select>
								</div>
							  </div>
							</div>
                        </div>
                        <div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">起始读数</label>
									<div class="controls">
										<input class="input-xlarge focused" id="start" name="start" type="text" value="${(anmeter.start)?if_exists}">
									</div>
								</div>
								</fieldset> 
							</div>
							
                        </div>
						<div class="row-fluid">
							<div class="span12">
								<div class="control-group form-horizontal">
									<label class="control-label" for="focusedInput">换表记录</label>
									<div class="controls">
										<textarea class="" id="record" rows="3">${(anmeter.record)?if_exists}</textarea>
									</div>
								</div>
							</div>
						</div>
						<button type="button" class="btn btn-primary" onclick="javascript:addTr2();">添加</button>
						<button type="button" class="btn btn-primary" onclick="javascript:delTr2();">删除</button>
						<table class="table table-bordered table-striped table-condensed" id="dynamictable">
							  <thead>
								  <tr>
								      <th></th>
									  <th>房号</th>
									  <th>住户姓名</th>
									  <th>人口数</th>
									  <th>承担比例（1表示100%，0.3表示30%）</th>
									  <th>备注</th>
								  </tr>
							  </thead>   
							  <tbody>
							    <#assign index=1>
							    <#list (anmeter.anmeterRooms)?if_exists as room>
								<tr>
									<td><input type='checkbox' id='inlineCheckbox1'  name='ckb' value='${(index)?if_exists}'></td>
									<td><input class='input-xlarge focused' disabled id='roomrcode' name='roomrcode' type='text' value='${(room.roomcode)?if_exists}'></td>
		   			                <td class='center'>
		   								<input class='input-small focused' id='rcode' name='rcode' type='hidden' value='${(room.residents.rcode)?if_exists}'>
		   								<input class='input-small focused' id='rid' name='rid' type='hidden' value='${(room.room.rid)?if_exists}'>
		   								<input class='input-small focused' disabled id='rname' name='rname' type='text' value='${(room.pname)?if_exists}'>
		   							</td>
		   							<td class='center'><input class='input-small focused' disabled id='rnum' name='rnum' type='text' value='${(room.pnum)?if_exists}'></td>
		   							<td class='center'><input class='input-small focused' id='compare' name='compare' type='text' value='${(room.compare)?if_exists}'></td>
		   							<td class='center'><input class='input-small focused' id='content' name='content' type='text' value='${(room.content)?if_exists}'></td>
	   							</tr>
	   							<#assign index=index+1>
								</#list>
							  </tbody>
						  </table>
                      </div>
					  
                      </div> 
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
		    </form>
       
			<!-- content ends -->
			</div><!--/#content.span10-->
		</div><!--/fluid-row-->

		
	</div><!--/.fluid-container-->
	<div class="modal hide" id="myroominfo">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">×</button>
			<h3>房间信息</h3>
		</div>
		<div class="modal-body">
			<p>
				<div id="" class="box-content">
					 <div class="zTreeDemoBackground left">
						    <ul id="menup" class="ztree"></ul>
					 </div> 
				</div>
			</p>
		</div>
		<div class="modal-footer">
		    <a href="javascript:chose('dynamictable',-1);" class="btn" id="chose">选择</a>
			<a href="#" class="btn" id="closewin2" data-dismiss="modal">关闭</a>
		</div>
    </div>
	<#include "*/infotemplate/alert.ftl">
    <#include "*/infotemplate/saveinfo.ftl">
	<#include "*/pubjs.ftl">
	<script src='${base}/script/dashboard/anmeter_edit.js'></script>	
	<script src='${base}/script/number.js'></script>	
		
</body>
</html>
